import dayjs from "dayjs";
import { formatNumber } from "./formatNumber";

export function formatTime(date: any, format: string = `YYYY-MM-DD HH:mm:ss`){
    return dayjs(date).format(format)
}

export function formatMinute(value: number) {
    if(value <= 0) return `00:00`
    value = parseInt(`${value}`)
    const minute = Math.floor(value / 60)
    const second = value % 60;
    return `${formatNumber(minute)}:${formatNumber(second)}`
}

